package org.wz.complex.work.mapper.auth.sysinfo;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.wz.complex.work.bean.Keyvalue;
import org.wz.complex.work.bean.Res;
import org.wz.complex.work.entity.auth.sysinfo.SysinfoMicro;

import java.util.List;

@Mapper
public interface SysinfoMicroMapper extends BaseMapper<SysinfoMicro> {

    @Select("""
         SELECT '项目' as key1 , count(1) as value1  FROM project_code_java AS a WHERE a.deploy = #{deploy}  
         UNION ALL  
         SELECT '数据源' as key1 , count(1) as value1  FROM project_database_source AS a WHERE a.deploy = #{deploy}  
         UNION ALL  
         SELECT '链接' as key1 , count(1) as value1  FROM project_test_open  
         UNION ALL  
         SELECT '面试题' as key1 , count(1) AS value1 FROM project_test_question  
    """)
    List<Keyvalue> statistics(@Param("deploy") String deploy);

}
